#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=1e2+100;
typedef long long LL;
const LL mod=998244353;
inline LL read(){LL x=0,f=1;char ch=getchar();	while (!isdigit(ch)){if (ch=='-') f=-1;ch=getchar();}while (isdigit(ch)){x=x*10+ch-48;ch=getchar();}
return x*f;}
LL ksm(LL a,LL k){
   LL res=1;
   while(k){
        if(k&1) res=res*a%mod;
        a=a*a%mod;
        k>>=1;
   }return res%mod;
}
int main(void){
    LL n;n=read();n--;
    if(n==0){
        printf("0\n");
        return 0;
    }
    else if(n==1){
        printf("1\n");
    }
    else printf("%lld\n",( (n%mod*(n+1)%mod)%mod*ksm(2,n-2)%mod)%mod );
   	return 0;
}
